{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Creating a Simple Model for SEI Growth\n",
    "Before adding a new model, please read the [contribution guidelines](https://github.com/pybamm-team/PyBaMM/blob/develop/CONTRIBUTING.md)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this notebook, we will run through the steps involved in creating a new model within pybamm. We will then solve and plot the outputs of the model. We have chosen to implement a very simple model of SEI growth. We first give a brief derivation of the model and discuss how to nondimensionalise the model so that we can show the full process of model conception to solution within a single notebook.  "
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note: if you run the entire notebook and then try to evaluate the earlier cells, you will likely receive an error. This is because the state of objects is mutated as it is passed through various stages of processing. In this case, we recommend that you restart the Kernel and then evaluate cells in turn through the notebook. "
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## A Simple Model of Solid Electrolyte Interphase (SEI) Growth"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The SEI is a porous layer that forms on the surfaces of negative electrode particles from the products of electrochemical reactions which consume lithium and electrolyte solvents. In the first few cycles of use, a lithium-ion battery loses a large amount of capacity; this is generally attributed to lithium being consumed to produce SEI. However, after a few cycles, the rate of capacity loss slows at a rate often (but not always) reported to scale with the square root of time. SEI growth is therefore often considered to be limited in some way by a diffusion process."
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Dimensional Model\n",
    "\n",
    "In our simple SEI model, we consider a one-dimensional SEI which extends from the surface of a planar negative electrode at $x=0$ until $x=L$, where $L$ is the thickness of the SEI. Since the SEI is porous, there is some electrolyte within the region $x\\in[0, L]$ and therefore some concentration of solvent, $c$. Within the porous SEI, the solvent is transported via a diffusion process according to:\n",
    "$$\n",
    "\\frac{\\partial c}{\\partial t} = - \\frac{\\partial N}{\\partial x}, \\quad N = - D(c) \\frac{\\partial c}{\\partial x} \\label{1}\\\\\n",
    "$$\n",
    "where $t$ is the time, $N$ is the solvent flux, and $D(c)$ is the effective solvent diffusivity (a function of the solvent concentration).\n",
    "\n",
    "On the electrode-SEI surface ($x=0$) the solvent is consumed by the SEI growth reaction, $R$. We assume that diffusion of solvent in the bulk electrolyte ($x>L$) is fast so that on the SEI-electrolyte surface ($x=L$) the concentration of solvent is fixed at the value $c_{\\infty}$. Therefore, the boundary conditions are\n",
    "$$\n",
    "    N|_{x=0} = - R, \\quad c|_{x=L} = c_{\\infty},\n",
    "$$\n",
    "We also assume that the concentration of solvent within the SEI is initially uniform and equal to the bulk electrolyte solvent concentration, so that the initial condition is\n",
    "$$\n",
    "   c|_{t=0} = c_{\\infty}\n",
    "$$\n",
    "\n",
    "Since the SEI is growing, we require an additional equation for the SEI thickness. The thickness of the SEI grows at a rate proportional to the SEI growth reaction $R$, where the constant of proportionality is the partial molar volume of the reaction products, $\\hat{V}$. We also assume that the SEI is initially of thickness $L_0$. Therefore, we have\n",
    "$$\n",
    "    \\frac{d L}{d t} = \\hat{V} R, \\quad L|_{t=0} = L_0\n",
    "$$\n",
    "\n",
    "Finally, we assume for the sake of simplicity that the SEI growth reaction is irreversible and that the potential difference across the SEI is constant. The reaction is also assumed to be proportional to the concentration of solvent at the electrode-SEI surface ($x=0$). Therefore, the reaction flux is given by\n",
    "$$\n",
    " R = k c|_{x=0}\n",
    "$$\n",
    "where $k$ is the reaction rate constant (which is in general dependent upon the potential difference across the SEI).\n",
    "\n",
    "### Fixing the moving boundary\n",
    "The model above is a moving boundary problem as it is defined in $x\\in[0, L]$. In order to solve it, we need to fix the boundary by introducing the scaling\n",
    "$$\n",
    "    x = L \\xi.\n",
    "$$\n",
    "Then, applying the chain rule we have\n",
    "$$\n",
    "    \\frac{\\partial}{\\partial x} \\rightarrow \\frac{1}{L} \\frac{\\partial}{\\partial \\xi}, \\quad \\text{ and } \\quad \\frac{\\partial}{\\partial t} \\rightarrow \\frac{\\partial}{\\partial t} - \\frac{L'(t)}{L(t)} \\xi \\frac{\\partial}{\\partial \\xi}.\n",
    "$$\n",
    "\n",
    "Then, (1) can be rewritten as\n",
    "$$\n",
    "    \\frac{\\partial c}{\\partial t} = \\frac{\\hat{V} R}{L} \\xi \\frac{\\partial c}{\\partial \\xi} + \\frac{1}{L^2} \\frac{\\partial}{\\partial \\xi} \\left( D(c) \\frac{\\partial c}{\\partial \\xi}\\right)\n",
    "$$"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Entering the Model into PyBaMM"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As always, we begin by importing PyBaMM and changing our working directory to the root of the `pybamm/` folder."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.0.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.2\u001b[0m\n",
      "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n",
      "Note: you may need to restart the kernel to use updated packages.\n"
     ]
    }
   ],
   "source": [
    "%pip install \"pybamm[plot,cite]\" -q    # install PyBaMM if it is not installed\n",
    "import os\n",
    "\n",
    "import numpy as np\n",
    "\n",
    "import pybamm\n",
    "\n",
    "os.chdir(pybamm.__path__[0] + \"/..\")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A model is defined in six steps:\n",
    "1. Initialise model\n",
    "2. Define parameters and variables\n",
    "3. State governing equations\n",
    "4. State boundary conditions\n",
    "5. State initial conditions\n",
    "6. State output variables\n",
    "\n",
    "We shall proceed through each step to enter our simple SEI growth model."
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Initialise model"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We first initialise the model using the `BaseModel` class. This sets up the required structure for our model. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = pybamm.BaseModel()"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Define parameters and variables"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In our SEI model, we have two dimensionless parameters, $k$ and $\\hat{V}$, and one dimensionless function $D(c)$, which are all given in terms of the dimensional parameters, see (5). In pybamm, inputs are dimensional, so we first state all the dimensional parameters. We then define the dimensionless parameters, which are expressed an non-dimensional groupings of dimensional parameters. To define the dimensional parameters, we use the `Parameter` object to create parameter symbols. Parameters which are functions are defined using  `FunctionParameter` object and should be defined within a python function as shown. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# dimensional parameters\n",
    "k = pybamm.Parameter(\"Reaction rate constant [m.s-1]\")\n",
    "L_0 = pybamm.Parameter(\"Initial thickness [m]\")\n",
    "V_hat = pybamm.Parameter(\"Partial molar volume [m3.mol-1]\")\n",
    "c_inf = pybamm.Parameter(\"Bulk electrolyte solvent concentration [mol.m-3]\")\n",
    "\n",
    "\n",
    "def D(cc):\n",
    "    return pybamm.FunctionParameter(\n",
    "        \"Diffusivity [m2.s-1]\", {\"Solvent concentration [mol.m-3]\": cc}\n",
    "    )"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We now define the dimensionless variables in our model. Since these are the variables we solve for directly, we do not need to write them in terms of the dimensional variables. We simply use `SpatialVariable` and `Variable` to create the required symbols: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "xi = pybamm.SpatialVariable(\"xi\", domain=\"SEI layer\", coord_sys=\"cartesian\")\n",
    "c = pybamm.Variable(\"Solvent concentration [mol.m-3]\", domain=\"SEI layer\")\n",
    "L = pybamm.Variable(\"SEI thickness [m]\")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### State governing equations"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can now use the symbols we have created for our parameters and variables to write out our governing equations. Note that before we use the reaction flux and solvent flux, we must derive new symbols for them from the defined parameter and variable symbols. Each governing equation must also be stated in the explicit form `d/dt = rhs` since pybamm only stores the right hand side (rhs) and assumes that the left hand side is the time derivative. The governing equations are then simply"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# SEI reaction flux\n",
    "R = k * pybamm.BoundaryValue(c, \"left\")\n",
    "\n",
    "# solvent concentration equation\n",
    "N = -1 / L * D(c) * pybamm.grad(c)\n",
    "dcdt = (V_hat * R) / L * pybamm.inner(xi, pybamm.grad(c)) - 1 / L * pybamm.div(N)\n",
    "\n",
    "# SEI thickness equation\n",
    "dLdt = V_hat * R"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Once we have stated the equations, we can add them to the `model.rhs` dictionary. This is a dictionary whose keys are the variables being solved for, and whose values correspond right hand sides of the governing equations for each variable."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "model.rhs = {c: dcdt, L: dLdt}"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### State boundary conditions"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We only have boundary conditions on the solvent concentration equation. We must state where a condition is Neumann (on the gradient) or Dirichlet (on the variable itself). \n",
    "\n",
    "The boundary condition on the electrode-SEI (x=0) boundary is: \n",
    "$$\n",
    "    N|_{\\xi=0} = - R, \\quad  N|_{\\xi=0} = - D(c|_{\\xi=0} )\\left.\\frac{\\partial c}{\\partial \\xi}\\right|_{\\xi=0}\n",
    "$$\n",
    "which is a Neumann condition. To implement this boundary condition in pybamm, we must first rearrange the equation so that the gradient of the concentration, $\\nabla c|_{x=0}$, is the subject. Therefore we have\n",
    "$$\n",
    "    \\left.\\frac{\\partial c}{\\partial \\xi}\\right|_{\\xi=0} = \\frac{R L}{D(c|_{\\xi=0} )}\n",
    "$$\n",
    "which we enter into pybamm as   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "D_left = pybamm.BoundaryValue(\n",
    "    D(c), \"left\"\n",
    ")  # pybamm requires BoundaryValue(D(c)) and not D(BoundaryValue(c))\n",
    "grad_c_left = R * L / D_left"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "On the SEI-electrolyte boundary ($\\xi=1$), we have the boundary condition\n",
    "$$\n",
    "    c|_{\\xi=1} = c_∞\n",
    "$$"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "which is a Dirichlet condition and is just entered as"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "c_right = c_inf"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We now load these boundary conditions into the `model.boundary_conditions` dictionary in the following way, being careful to state the type of boundary condition: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "model.boundary_conditions = {\n",
    "    c: {\"left\": (grad_c_left, \"Neumann\"), \"right\": (c_right, \"Dirichlet\")}\n",
    "}"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### State initial conditions"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are two initial conditions in our model:\n",
    "$$\n",
    "    c|_{t=0} = c_∞, \\quad L|_{t=0} = L_0\n",
    "$$"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "which are simply written in pybamm as"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "c_init = c_inf\n",
    "L_init = L_0"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "and then included into the `model.initial_conditions` dictionary:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "model.initial_conditions = {c: c_init, L: L_init}"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### State output variables"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We already have everything required in model for the model to be used and solved, but we have not yet stated what we actually want to output from the model. PyBaMM allows users to output any combination of symbols as an output variable therefore allowing the user the flexibility to output important quantities without further tedious postprocessing steps. \n",
    "\n",
    "Some useful outputs for this simple model are:\n",
    "- the SEI thickness\n",
    "- the SEI growth rate\n",
    "- the solvent concentration\n",
    "\n",
    "These are added to the model by adding entries to the `model.variables` dictionary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "model.variables = {\n",
    "    \"SEI thickness [m]\": L,\n",
    "    \"SEI growth rate [m]\": dLdt,\n",
    "    \"Solvent concentration [mol.m-3]\": c,\n",
    "}"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The model is now fully defined and ready to be used. If you plan on reusing the model several times, you can additionally set model defaults which may include: a default geometry to run the model on, a default set of parameter values, a default solver, etc."
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Using the Model"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The model will now behave in the same way as any of the inbuilt PyBaMM models. However, to demonstrate that the model works we display the steps involved in solving the model but we will not go into details within this notebook."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pybamm.models.base_model.BaseModel at 0x7f3a8005b490>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# define geometry\n",
    "geometry = pybamm.Geometry(\n",
    "    {\"SEI layer\": {xi: {\"min\": pybamm.Scalar(0), \"max\": pybamm.Scalar(1)}}}\n",
    ")\n",
    "\n",
    "\n",
    "def Diffusivity(cc):\n",
    "    return cc * 10 ** (-12)\n",
    "\n",
    "\n",
    "# parameter values (not physically based, for example only!)\n",
    "param = pybamm.ParameterValues(\n",
    "    {\n",
    "        \"Reaction rate constant [m.s-1]\": 1e-6,\n",
    "        \"Initial thickness [m]\": 1e-6,\n",
    "        \"Partial molar volume [m3.mol-1]\": 10,\n",
    "        \"Bulk electrolyte solvent concentration [mol.m-3]\": 1,\n",
    "        \"Diffusivity [m2.s-1]\": Diffusivity,\n",
    "    }\n",
    ")\n",
    "\n",
    "# process model and geometry\n",
    "param.process_model(model)\n",
    "param.process_geometry(geometry)\n",
    "\n",
    "# mesh and discretise\n",
    "submesh_types = {\"SEI layer\": pybamm.Uniform1DSubMesh}\n",
    "var_pts = {xi: 100}\n",
    "mesh = pybamm.Mesh(geometry, submesh_types, var_pts)\n",
    "\n",
    "spatial_methods = {\"SEI layer\": pybamm.FiniteVolume()}\n",
    "disc = pybamm.Discretisation(mesh, spatial_methods)\n",
    "disc.process_model(model)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# solve\n",
    "solver = pybamm.ScipySolver()\n",
    "t = [0, 100]  # solve for 100s\n",
    "solution = solver.solve(model, t)\n",
    "\n",
    "# post-process output variables\n",
    "L_out = solution[\"SEI thickness [m]\"]\n",
    "c_out = solution[\"Solvent concentration [mol.m-3]\"]"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Using these outputs, we can now plot the SEI thickness as a function of time and also the solvent concentration profile within the SEI. We use a slider to plot the concentration profile at different times. Note that, even though our model is written in nondimensional form, the processed variables are functions of dimensional space and time (in SI units). "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0f4941d4712049e494267074dca70b4b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(FloatSlider(value=0.0, description='t'), Output()), _dom_classes=('widget-interact',))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# plot SEI thickness in microns as a function of t in microseconds\n",
    "# and concentration in mol/m3 as a function of x in microns\n",
    "L_0_eval = param.evaluate(L_0)\n",
    "xi = np.linspace(0, 1, 100)  # dimensionless space\n",
    "\n",
    "\n",
    "def plot(t):\n",
    "    _, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5))\n",
    "    ax1.plot(solution.t, L_out(solution.t) * 1e6)\n",
    "    ax1.plot(t, L_out(t) * 1e6, \"r.\")\n",
    "    ax1.set_ylabel(r\"SEI thickness [$\\mu$m]\")\n",
    "    ax1.set_xlabel(r\"t [s]\")\n",
    "\n",
    "    ax2.plot(xi * L_out(t) * 1e6, c_out(t, xi))\n",
    "    ax2.set_ylim(0, 1.1)\n",
    "    ax2.set_xlim(0, L_out(solution.t[-1]) * 1e6)\n",
    "    ax2.set_ylabel(\"Solvent concentration [mol.m-3]\")\n",
    "    ax2.set_xlabel(r\"x [$\\mu$m]\")\n",
    "\n",
    "    plt.tight_layout()\n",
    "    plt.show()\n",
    "\n",
    "\n",
    "import ipywidgets as widgets\n",
    "\n",
    "widgets.interact(\n",
    "    plot, t=widgets.FloatSlider(min=0, max=solution.t[-1], step=0.1, value=0)\n",
    ");"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Formally adding your model"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The purpose of this notebook has been to go through the steps involved in getting a simple model working within PyBaMM. However, if you plan on reusing your model and want greater flexibility then we recommend that you create a new class for your model. We have set out instructions on how to do this in the \"Adding a Model\" tutorial in the documentation. "
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## References\n",
    "\n",
    "The relevant papers for this notebook are:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1] Joel A. E. Andersson, Joris Gillis, Greg Horn, James B. Rawlings, and Moritz Diehl. CasADi – A software framework for nonlinear optimization and optimal control. Mathematical Programming Computation, 11(1):1–36, 2019. doi:10.1007/s12532-018-0139-4.\n",
      "[2] Charles R. Harris, K. Jarrod Millman, Stéfan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, and others. Array programming with NumPy. Nature, 585(7825):357–362, 2020. doi:10.1038/s41586-020-2649-2.\n",
      "[3] Valentin Sulzer, Scott G. Marquis, Robert Timms, Martin Robinson, and S. Jon Chapman. Python Battery Mathematical Modelling (PyBaMM). Journal of Open Research Software, 9(1):14, 2021. doi:10.5334/jors.309.\n",
      "[4] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, and others. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods, 17(3):261–272, 2020. doi:10.1038/s41592-019-0686-2.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "pybamm.print_citations()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.13 ('conda_jl')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  },
  "vscode": {
   "interpreter": {
    "hash": "612adcc456652826e82b485a1edaef831aa6d5abc680d008e93d513dd8724f14"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
